package Code;

//找质数：判断101-200之间有多少个素数，并输出所有素数。
public class Test2 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 101; i <200 ; i++) {
            if (primeNumber(i)){
                System.out.print(i+" ");
                count++;
            }
        }
        System.out.println("一共有"+count+"个质数");
    }
    public static boolean primeNumber(int number){

        for (int i = 2; i < (number/2); i++) {
            if (number% i == 0){
                return false;
            }
        }
        return true;
    }
}
